package com.example.ploy4j.entity;

public enum DeploymentStatus {
    PENDING("待处理"),
    GIT_PULLING("拉取代码中"),
    GIT_PULLED("代码拉取完成"),
    BUILDING("构建中"),
    BUILD_SUCCESS("构建成功"),
    BUILD_FAILED("构建失败"),
    UPLOADING("上传中"),
    UPLOAD_SUCCESS("上传成功"),
    UPLOAD_FAILED("上传失败"),
    KILLING_REMOTE("停止远程进程"),
    KILL_REMOTE_SUCCESS("远程进程已停止"),
    KILL_REMOTE_FAILED("停止远程进程失败"),
    STARTING_REMOTE("启动远程进程"),
    REMOTE_STARTED("远程进程已启动"),
    REMOTE_START_FAILED("启动远程进程失败"),
    SUCCESS("部署成功"),
    FAILED("部署失败"),
    CANCELLED("已取消");

    private final String displayName;

    DeploymentStatus(String displayName) {
        this.displayName = displayName;
    }

    public String getDisplayName() {
        return displayName;
    }

    // Optional: if you need to find an enum by its display name
    public static DeploymentStatus fromDisplayName(String displayName) {
        for (DeploymentStatus status : DeploymentStatus.values()) {
            if (status.displayName.equalsIgnoreCase(displayName)) {
                return status;
            }
        }
        return null; // Or throw an exception
    }
} 